package cw.spring.security.acl.poc.services.impl;

import cw.spring.security.acl.poc.security.AcegiSecurityManager;
import cw.spring.security.acl.poc.services.IAuthenticationService;

public class AuthenticationService implements IAuthenticationService {

  private AcegiSecurityManager securityManager;

  /*
   * (non-Javadoc)
   * 
   * @see cw.spring.security.acl.poc.services.impl.IAuthenticationService#authenticate(java.lang.String, java.lang.String)
   */
  public String authenticate(String login, String password) {
    String sessionId = securityManager.authenticate(login, password);
    return sessionId;
  }

  /*
   * (non-Javadoc)
   * 
   * @see cw.spring.security.acl.poc.services.impl.IAuthenticationService#checkCredentials(java.lang.String, java.lang.String)
   */
  public boolean checkCredentials(String login, String password) {
    return securityManager.checkCredentials(login, password);
  }

  /*
   * (non-Javadoc)
   * 
   * @see cw.spring.security.acl.poc.services.impl.IAuthenticationService#getSecurityManager()
   */
  public AcegiSecurityManager getSecurityManager() {
    return securityManager;
  }

  /*
   * (non-Javadoc)
   * 
   * @see cw.spring.security.acl.poc.services.impl.IAuthenticationService#setSecurityManager(cw.spring.security.acl.poc.security.AcegiSecurityManager)
   */
  public void setSecurityManager(AcegiSecurityManager securityManager) {
    this.securityManager = securityManager;
  }

}